<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<script src="../js/jquery-2.1.0.js"></script>
	</head>

	<body>
		<label>电子邮箱</label>
		<input type="text" id="mail" name="mail" />
		<input type="checkbox" name="check" class="checks" />运动
		<input type="checkbox" name="check" class="checks" />运动
		<input type="checkbox" name="check" class="checks" />运动
		<input type="submit" value="提交" class="tijiao" />
	</body>
	<script>
		$(function() {
			$(".tijiao").click(function() {
				var mails = $("#mail").val();
				if(mails.indexOf("@") < 1 || mails.indexOf(".") < 1) {
					alert("邮箱地址错误");
					return false;
				}
				var checks = $("input[name='check']:checked");
				if(checks.length == 0) {
					alert("至少选一个");
					return false;
				}

				return true;
			});
		});
	</script>

</html>